﻿using NHibernate;

namespace AiFrame.InterfaceLib.Data.Access.NHibernateAccess
{
    /// <summary>
    /// Describes a replaceable session manager for
    /// NHibernate.
    /// </summary>
    public interface INHibernateSessionManager
    {
        /// <summary>
        /// Returns the session for the given database
        /// connection.
        /// </summary>
        /// <param name="databaseConnection"></param>
        /// <returns></returns>
        ISession GetSession(INhibernateHelper databaseConnection);

        /// <summary>
        /// Closes the session.
        /// </summary>
        void CloseSession();
    }
}
